package com.hhss.qishi.controller.rabbitmq;

import com.hhss.qishi.config.log.Log;
import org.slf4j.Logger;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.LinkedList;
import java.util.List;

/**
 * @Auther: zcc
 * @Date: 19-7-23 16:55
 * @Description: 消息队列的消费者
 */
//@Component
//@RabbitListener(queues = RabbitConfig.QUEUE_A)
public class Consumer {

    static List<String> receivedMessageList = new LinkedList<>();

    @Log
    Logger logger;

    @RabbitHandler
    public void process(String content) {
        logger.info("接收处理队列A当中的消息： " + content);
        receivedMessageList.add(content);
    }

}
